package com.primeton.wh.mcenter.schedule;

import com.primeton.wh.mcenter.impl.message.service.IMessageService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.PropertySource;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author: YunTao.Li
 * @create: 2020-05-18 12:05
 * @description: 定时器服务
 **/
@Slf4j
@Component
@PropertySource({"classpath:application.yml"})
public class ScheduledService {

    @Autowired
    private IMessageService messageService;

    @Scheduled(cron = "${prop.message-scan-cron}")
    public void unEffectMessageScaner() {
        try {
            messageService.unEffectMessageScaner();
        } catch (Throwable throwable) {
            throwable.printStackTrace();
        }
    }

}
